Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate salt-master to Ubuntu 22.04('Jammy') #331

Merged
merged 11 commits into from
Jan 16, 2024
Merged

Migrate salt-master to Ubuntu 22.04('Jammy') #331

merged 11 commits into from
Jan 16, 2024

Conversation

cegerhardson
Copy link
Contributor

@cegerhardson cegerhardson commented Jan 9, 2024

This PR migrates our salt-master to run on Ubuntu 22.04, codename "Jammy."

In our previous configuration running salt 3004, the salt-master ran as the root user. In the latest release, the salt-master adds a "salt" user and group by default, and runs as the "salt" user. By adding user: root to out vagrant master.conf file, we allow the salt-master to run as root, like we had previously done, and bypass permissions errors related to loading ca.py and consul.py modules.

This PR also conditionally updates our configuration to use the onedir packaging with codename "jammy" updating the repo URL, path names, and GPG key.

To verify this locally:

  1. bring up the salt-master, laptop:psf-salt user$ vagrant up salt-master
  2. bring up the loadbalancer, laptop:psf-salt user$ vagrant up loadbalancer
  3. bring up a backend service like hg, laptop:psf-salt user$ vagrant up hg

The traceback for the salt-master should show it running on jammy, but to further verify the upgrade:

  1. in another window, ssh into the salt-master, laptop:psf-salt user$ vagrant ssh salt-master
  2. run the command lsb_release -a
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04
Codename:	jammy

Note:

  • apt-key is deprecated with Ubuntu 22.04. The recommended approach is to configure -aptkey: False to the package repo state, and set signed-by in the repo name.

  • This PR is currently in a state where all packages are updated to use this recommended approach except for postgresql.

  • The current bug appears to happen when salt adds the postgresql gpg key to our designated signed by file, the file permissions are not set the _apt user to read.

-rw-r--r-- 1 root root 4538 Jan 12 13:52 datadoghq.gpg
-rw-r--r-- 1 root root 1067 Jan 12 13:52 nginx.gpg
-rw-r--r-- 1 root root 2820 Jan 12 13:51 packagecloud.gpg
-rw-r----- 1 root root 3494 Jan 12 13:52 postgresql.gpg

To learn more about this bug, see #333.

This commit uncomments out code that will migrate our salt-master to run using Ubuntu 22.04 codename 'jammy'.
In our previoius configuration, the salt master was running as root user. When migrating to salt latest 3006, the salt-master defaults to running as the salt user.
To bypass permissions errors around loading `consul.py` and `ca.py`, this commit runs the salt-master as the root user as done previously before attempting to upgrade salt.
The `python-requests` and `python-msgpack` packages were not getting loaded for our salt-master because there was no condtion to match it's oscodename. This commit changes that.
This commit applies a condition for codename jammy to use the appropriate salt repository, updating the repo URL, path name, and GPG key for Ubuntu 22.04.
Adjust `consul` configuration for compatibility with Ubuntu 22.04 ('Jammy')
@cegerhardson cegerhardson requested a review from ewdurbin as a code owner January 9, 2024 20:40
Copy link
Member

@ewdurbin ewdurbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this looks good and is working as expected!

Two questions. One (comment) is just tidiness and the other is probably best to nip in the bud now rather than get caught by it later.

Vagrantfile Outdated
@@ -41,10 +41,10 @@ Vagrant.configure("2") do |config|

config.vm.define "salt-master" do |s_config|
# Uncomment below to migrate salt-master to jammy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment necessary anymore?

salt/base/salt.sls Show resolved Hide resolved
This comment is no longer necessary, as the salt-master now runs on Ubuntu 22.04 codename "Jammy".
- this change reflects the GPG keyring name, and apt source file list in [Salt Install Guide]https://docs.saltproject.io/salt/install-guide/en/latest/topics/install-by-operating-system/ubuntu.html)
- this commit addresses the recommended approach for [apt-key deprecation in Ubunut 22.04](https://docs.saltproject.io/en/latest/ref/states/all/salt.states.pkgrepo.html)
- this commit addresses the reccomended approach for  [apt-key deprecation in Ubunut 22.04](https://docs.saltproject.io/en/latest/ref/states/all/salt.states.pkgrepo.html)
- this commit addresses the reccomended approach for  [apt-key deprecation in Ubunut 22.04](https://docs.saltproject.io/en/latest/ref/states/all/salt.states.pkgrepo.html)
- this commit addresses the reccomended approach for  [apt-key deprecation in Ubunut 22.04](https://docs.saltproject.io/en/latest/ref/states/all/salt.states.pkgrepo.html)
@ewdurbin ewdurbin merged commit a89c21d into main Jan 16, 2024
2 checks passed
@ewdurbin ewdurbin deleted the jammy branch January 16, 2024 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants